@extends('admin.layout.index')
@section('content')
<div class="col-lg-6" id="subadver" style="display:none;position: fixed;top:100px;left:500px;z-index:5">
    <div class="card">
        <div class="card-action">
            广告位创建中······
        </div>
        <div class="card-content">
            <form class="col s12" action="/admin/carousel/addadver" enctype="multipart/form-data" method="post">
         	{{ csrf_field() }}
				<div class="row">
					<div class="input-field col s6">
					<i class="material-icons prefix">account_circle</i>
					<input id="icon_prefix" type="text" name="name" class="validate" required>
					<label for="icon_prefix">广告位名</label>
				    </div>
				</div>
                <div class="input-field col s12" >
                    <i class="material-icons prefix">language</i>
                    <input id="" class="validate" type="text" name="url" value="">
                    <label for="url" class="">广告位连接</label>
                </div>
        	    <div class="file-field input-field">

        	        <div class="btn">
            	        <span>广告图片创建</span>
            	        <input type="file" name="pic" multiple="" required>
        	        </div>
                    <div class="file-path-wrapper">
                        <input class="file-path validate"  type="text" placeholder="上传你的广告图片">
                    </div>
                </div>
                <button type="submit" class="btn btn-default"> 确认创建 </button>
                <hr>
            </form>
	       <button type="submit" class="btn btn-default"> 取消创建 </button>
	       <div class="clearBoth"></div>
	    </div>
	</div>
</div>
<div class="col-md-12">
    <!--    Striped Rows Table  -->
    <div class="card">
        <div class="card-action">
            首页广告位管理
        </div>
        <div class="card-content">
        	<a href="javascript:;" onclick="addadver()" class="waves-effect waves-light btn-large"><i class="material-icons right">cloud</i>添加广告位</a>
            <div class="table">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>广告位名称</th>
                            <th>广告位图片</th>
                            <th>广告位连接</th>
                            <th>广告位时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    	@foreach($adverShow as $value)
                        <tr>
                            <td style="height:100px"><a href="{{ $value['adverurl'] }}">{{ $value['advername'] }}</a></td>
                            <td><img width="100px" height="100px" src="{{ $value['adverphoto'] }}" onerror="this.src='/adminassets/adver/lazyload-8b704ceeec.gif'" alt=""></td>
                            <td style="word-break:break-all;width:200px">{{ $value['adverurl'] }}</td>
                            <td>{{ date('Y-m-d h:i:s') }}</td>
                            <td>
                                <a href="javascript:;"  onclick="mydel(this)" card="{{ $value['id'] }}" title='删除' style="color:#333;font-size:17px"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
                                <a href="/admin/carousel/aedit/{{ $value['id'] }}" title='修改' style="color:#333;margin-left:20px;font-size:16px"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
                            </td>
                        </tr>
                        @endforeach
                        
                    </tbody>
                </table>
				<div style="position:fixed;left:700px;top:100px;display:none;overflow:hidden;width:300px;height:300px;z-index:6" id="bbdiv">
                	<img width="900px" height="900px" src="" onerror="this.src='/adminassets/adver/lazyload-8b704ceeec.gif'" alt="" id="bigimg">
                </div>
            </div>
        </div>
    </div>
    <!--  End  Striped Rows Table  -->
</div>
                
@endsection
@section('classified')
<script src="/adminassets/adver/adver.js"></script>
@endsection